package insight.app.config;

import insight.sm.dao.AssignmentsDAOImpl;
import insight.sm.dao.IAssignmentsDAO;
import insight.sm.dao.IEquipmentDAO;
import insight.sm.dao.EquipmentDAOImpl;
import insight.sm.dao.ILabourResourcesDAO;
import insight.sm.dao.IMaterialDAO;
import insight.sm.dao.IProjectDAO;
import insight.sm.dao.LabourResourcesDAOImpl;
import insight.sm.dao.MaterialDAOImpl;
import insight.sm.dao.ProjectDAOImpl;
import insight.sm.dao.ITaskDAO;
import insight.sm.dao.TaskDAOImpl;

import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DAOConfig {
	@Bean(autowire = Autowire.BY_NAME)
	
	public IProjectDAO projectDAO(){
		IProjectDAO projectDAO = new ProjectDAOImpl();
		System.out.println("instantiating  ProjectDAO");
		return projectDAO;
	}
	
	@Bean(autowire = Autowire.BY_NAME)
	public ITaskDAO taskDAO(){
		ITaskDAO taskDAO = new TaskDAOImpl();
		System.out.println("instantiating  TaskDAO");
		return taskDAO; 
	}
	
	@Bean(autowire = Autowire.BY_NAME)
	public IEquipmentDAO equipmentDAO(){
		IEquipmentDAO equipmentDAO = new EquipmentDAOImpl();
		System.out.println("instantiating  EquipmentDAO");
		return equipmentDAO;
	}

	@Bean(autowire = Autowire.BY_NAME)
	public IAssignmentsDAO assignmentsDAO(){
		IAssignmentsDAO assignmentsDAO = new AssignmentsDAOImpl();
		System.out.println("instantiating  AssignmentDAO");
		return assignmentsDAO;
	}
	
	@Bean(autowire = Autowire.BY_NAME)
	public ILabourResourcesDAO labourResourcesDAO(){
		ILabourResourcesDAO labourResourcesDAO = new LabourResourcesDAOImpl();
		System.out.println("instantiating  LabourResourcesDAO");
		return labourResourcesDAO;
	}
	
	@Bean(autowire = Autowire.BY_NAME)
	public IMaterialDAO materialDAO(){
		IMaterialDAO materialDAO = new MaterialDAOImpl();
		System.out.println("instantiating  MaterialDAO");
		return materialDAO;
	}
}
